/*
 *
 * Copyright 2020 gRPC authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H
#define GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H

/*  HTTP/2 error codes are mapped to the following cronet net error codes */
enum cronet_status_code {
  CRONET_STATUS_SUCCESS = 0,
  CRONET_STATUS_ILLEGAL_ARGUMENT = -100,
  CRONET_STATUS_ILLEGAL_ARGUMENT_STORAGE_PATH_MUST_EXIST = -101,
  CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_PIN = -102,
  CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HOSTNAME = -103,
  CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HTTP_METHOD = -104,
  CRONET_STATUS_ILLEGAL_ARGUMENT_INVALID_HTTP_HEADER = -105,
  CRONET_STATUS_ILLEGAL_STATE = -200,
  CRONET_STATUS_ILLEGAL_STATE_STORAGE_PATH_IN_USE = -201,
  CRONET_STATUS_ILLEGAL_STATE_CANNOT_SHUTDOWN_ENGINE_FROM_NETWORK_THREAD = -202,
  CRONET_STATUS_ILLEGAL_STATE_ENGINE_ALREADY_STARTED = -203,
  CRONET_STATUS_ILLEGAL_STATE_REQUEST_ALREADY_STARTED = -204,
  CRONET_STATUS_ILLEGAL_STATE_REQUEST_NOT_INITIALIZED = -205,
  CRONET_STATUS_ILLEGAL_STATE_REQUEST_ALREADY_INITIALIZED = -206,
  CRONET_STATUS_ILLEGAL_STATE_REQUEST_NOT_STARTED = -207,
  CRONET_STATUS_ILLEGAL_STATE_UNEXPECTED_REDIRECT = -208,
  CRONET_STATUS_ILLEGAL_STATE_UNEXPECTED_READ = -209,
  CRONET_STATUS_ILLEGAL_STATE_READ_FAILED = -210,
  CRONET_STATUS_NULL_POINTER = -300,
  CRONET_STATUS_NULL_POINTER_HOSTNAME = -301,
  CRONET_STATUS_NULL_POINTER_SHA256_PINS = -302,
  CRONET_STATUS_NULL_POINTER_EXPIRATION_DATE = -303,
  CRONET_STATUS_NULL_POINTER_ENGINE = -304,
  CRONET_STATUS_NULL_POINTER_URL = -305,
  CRONET_STATUS_NULL_POINTER_CALLBACK = -306,
  CRONET_STATUS_NULL_POINTER_EXECUTOR = -307,
  CRONET_STATUS_NULL_POINTER_METHOD = -308,
  CRONET_STATUS_NULL_POINTER_HEADER_NAME = -309,
  CRONET_STATUS_NULL_POINTER_HEADER_VALUE = -310,
  CRONET_STATUS_NULL_POINTER_PARAMS = -311,
  CRONET_STATUS_NULL_POINTER_REQUEST_FINISHED_INFO_LISTENER_EXECUTOR = -312,
};

const char* cronet_status_as_string(cronet_status_code status);

#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H */
